<!DOCTYPE html>
<html>
  <head>
    <title>客户列表</title>
    <meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>

<meta name="description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.
"/>

<link rel="stylesheet" th:href="@{/dist/lib/weui.min.css}" />
<link rel="stylesheet" th:href="@{/dist/css/jquery-weui.min.css}" />
<link rel="stylesheet" th:href="@{/dist/demos/css/demos.css}" />
<script type="text/javascript" th:src="@{/dist/lib/jquery-2.1.4.js}" ></script>
<script type="text/javascript" th:src="@{/dist/js/jquery-weui.js}" ></script>
<script type="text/javascript" th:src="@{/dist/lib/fastclick.js}" ></script>
<link rel="stylesheet" th:href="@{/adminltecss/userl.css}" />
<link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
   <style>
  	.header-wai{
  		position: fixed;top:0px; height:60px;background-color: #363436;
  	}
   </style>
   <script type="text/javascript" th:inline="javascript">
      $(function(){
    	  $("#changeCustomer").click(function(){
    		  var cid = $("#cid").val();
    		  var cname = $("#cname").val();
    		  var cgender1 =$("#cgender").val();
    		  var cgender = $.trim(cgender1);
    		  var cage = $("#cage").val();
    		  var cphone = $("#cphone").val();
    		  var cidcard = $("#cidcard").val();
    		  var cannualincome = $("#cannualincome").val();
    		  var chashousecount =$("#chashousecount").val();
    		  var cgrands = $("#cgrand").val();
    		  var cgrand = 0;
    		  if("白银"==cgrands){
    			  cgrand = 0;
    		  } 
    		  if("黄金"==cgrands){
    			  cgrand = 1;
    		  }
    		  if("钻石"==cgrands){
    			  cgrand = 2;
    		  }
    		  
    		  var cstates = $("#cstate").val();
    		  var cstate = 0;
    		  if("已看中"==cstates){
    			  cstate = 0;
    		  }
    		  if("已付定金"== cstates){
    			  cstate = 1;
    		  }
    		  if("已签合同"== cstates){
    			  cstate = 2;
    		  }
    		  
    		  
    		 
    		  var cmakestates = $("#cmakestate").val();
    		  var cmakestate = 0;
    		  if("新客户"==cmakestates){
    			  cmakestate = 0;
    		  }
    		  if("老客户"==cmakestates){
    			  cmakestate = 1;
    		  }
    		  var cmoney = $("#cmoney").val();
    		  var chousetype1 = $("#chousetype").val();
    		  var chousetype = $.trim(chousetype1);
    		  var cbuy = $("#cbuy").val();
    		  var cagains = $("#cagain").val();
    		  var cagain = 0;
    		  if("已购买"==cagains){
    			  cagain = 0;
    		  }
    		  if("未购买"==cagains){
    			  cagain = 1;
    		  }
    		  var customer={"cid":cid,"cname":cname,"cgender":cgender,"cage":cage,"cphone":cphone,"cidcard":cidcard,"cannualincome":cannualincome,
    			 "chashousecount":chashousecount,"cgrand":cgrand,"cmakestate":cmakestate,"cmoney":cmoney,"chousetype":chousetype,
    			 "cbuy":cbuy,"cagainstate":cagain
    		  };
    		  $.ajax({
    			  url:"/updateCustomer",
    			  type:"post",
    			  data:customer,
    			  dataType:"json",
    			  success:function(message){
    				  window.location.href="/selectCustomerForChangeok?cid="+message.cid;
    			  }
    			  
    		  });
    	  });
      });
   
      
      
   </script>
  </head>
  <body ontouchstart>
  <div class="weui-tabbar header-wai" style="">
  		<a th:href="@{/selectCustomer(cid=${customer.getCid()})}" class="weui-tabbar__item"  id="cusdow">
          <div class="weui-tabbar__icon"></div>
          <p class="weui-tabbar__label" style="font-size: 20px; color: white; line-height: 1px;">
          	<span class="fa fa-angle-left fa-2x" style="color: white; float: left;line-height: 10px;""></span>
          	修改信息<span class="" style="color: white;float: right; margin-right: 10px;line-height: 10px; " id="down"></span></p>
        </a>
      </div>
  	<div class="weui-grids">
  		
  	<div class="weui-cells weui-cells_form">
  	<!-- <form th:action="@{/updateCustomer}" method="post"> -->
     <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">客户编号</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="number" id="cid" pattern="[0-9]*" name="cid" th:attr="value=${customer.getCid()}"/>
        </div>
      </div>
      <div class="weui-cell weui-cell_vcode">
        <div class="weui-cell__hd">
          <label class="weui-label">姓名</label>
        </div>
        <div class="weui-cell__bd">
          <input class="weui-input" id="cname" type="text" name="cname" th:value="${customer.getCname()}"/>
        </div>
        
      </div>
      
      <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">性别</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" id="cgender" type="text" name="cgender" pattern="[0-9]*" id="cgender"/>
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">年龄</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="number" name="cage"  id="cage" />
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">电话</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="number" name="cphone" id="cphone" th:value="${customer.getCphone()}"/>
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"><label for="" class="weui-label">身份证号</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="number" name="cidcard" id="cidcard" value="" th:attr="value=${customer.getCidcard()}"/>
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"><label for="" class="weui-label">年收入</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="number" value="" id="cannualincome" name="cannualincome" th:attr="value=${customer.getCannualincome()}"/>
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"><label for="" class="weui-label">拥有房套数</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="number" value="" id="chashousecount" name="chashousecount" th:attr="value=${customer.getChashousecount()}"/>
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"><label for="" class="weui-label">客户等级</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="text" value="" id="cgrand" name="cgrand"/>
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"><label for="" class="weui-label">买房状态</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="text" value="" id="cstate" name="cstate"/>
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"><label for="" class="weui-label">预约状态</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="text" value="" id="cmakestate" name="cmakestate"/>
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"><label for="" class="weui-label">目标金额</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="number" value="" id="cmoney" name="cmoney" th:attr="value=${customer.getCmoney()}"/>
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"><label for="" class="weui-label">目标房类型</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="text" value="" id="chousetype" name="chousetype"/>
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"><label for="" class="weui-label">目标金额</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="number" value="" id="cbuy" name="cbuy" th:attr="value=${customer.getCbuy()}"/>
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"><label for="" class="weui-label">再次购买状态</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="text" value="" id="cagain" name="cagainstate"/>
        </div>
      </div>
      <div>
           <!-- <a th:href="@{/updateCustomer}" id='show-toast' class="weui- btn weui-btn_primary">点击确认修改</a> -->
      </div>
           <input type="button" class="weui-btn weui-btn_primary" id="changeCustomer" value="点击确认修改"/>
     <!--    </form> -->
    </div>
  			
  	
  	</div>
  	 
       <br/>
      <br/>
  	<div class="weui-tabbar" style="position: fixed;">

        <a th:href="@{/WHeadInfoController/intoMainPage}" class="weui-tabbar__item weui-bar__item--on">
          <!-- <span class="weui-badge" style="position: absolute;top: -.4em;right: 1em;">8</span> -->

          <div class="weui-tabbar__icon">
            
            <img th:src="@{/demos/images/icon_nav_button.png}" />
          </div>
          <p class="weui-tabbar__label">首页</p>
        </a>
        
        
         
        <!--判断是否登陆  -->
        <a href="javascript:void(0)" class="weui-tabbar__item" th:if="${session.EmployeeInfo!=null}"> 
          <div class="weui-tabbar__icon">
            <img th:src="@{/demos/images/icon_nav_msg.png}" alt=""/>
          </div>
          <p class="weui-tabbar__label">菜单</p>
        </a>
        
        <a th:href="@{/WBizController/loginDemo}" class="weui-tabbar__item" th:if="${session.EmployeeInfo==null}"> 
          <div class="weui-tabbar__icon">
            <img th:src="@{/demos/images/icon_nav_msg.png}" alt=""/>
          </div>
          <p class="weui-tabbar__label">菜单</p>
        </a>

		<!--判断是否登陆  -->
        <a th:href="@{/selectAllCustomers}" class="weui-tabbar__item" th:if="${session.EmployeeInfo!=null}">

          <div class="weui-tabbar__icon">
            <img th:src="@{/demos/images/icon_nav_article.png}" alt=""/>
          </div>
          <p class="weui-tabbar__label">客户</p>
        </a>
         <a th:href="@{/WBizController/loginDemo}" class="weui-tabbar__item" th:if="${session.EmployeeInfo==null}">

          <div class="weui-tabbar__icon">
            <img th:src="@{/demos/images/icon_nav_article.png}" alt=""/>
          </div>
          <p class="weui-tabbar__label">客户</p>
        </a>
        
        
        
        
        
        
        <a th:href="@{/WBizController/HeadPage}" class="weui-tabbar__item">
          <div class="weui-tabbar__icon">
            <img th:src="@{/demos/images/icon_nav_cell.png}" alt=""/>
          </div>
          <p class="weui-tabbar__label">我的</p>
        </a>
      </div>
      <script>
      	 $(document).on("click", "#show-toast", function() {
        $.toast("修改成功", function() {
          console.log('close');
        });
      })
      	 $("#cagain").picker({
        title: "请选择",
        cols: [
          {
            textAlign: 'center',
            values: ['', '']
          },
          {
            textAlign: 'center',
            values: ['已购买', '未购买']
          }
        ]
      });
      $("#cgender").picker({
        title: "请选择",
        cols: [
          {
            textAlign: 'center',
            values: ['', '']
          },
          {
            textAlign: 'center',
            values: ['男', '女']
          }
        ]
      });
      $("#cage").picker({
        title: "请选择",
        cols: [
          {
            textAlign: 'center',
            values: ['', '']
          },
          {
            textAlign: 'center',
            values: ['0', '1','2','3','4','5','6','7','8','9','10','11', '12','13','14','15','16','17','18','19','20','21',
            '22', '23','24','25','26','27','28','29','30','31','32','33', '34','35','36','37','38','39','40','41','42','43',
            '44', '45','46','47','48','49','50','51','52','53','54','55', '56','57','58','59','60','61','62','63','64','65',
            '66', '67','68','69','70','71','72','73','74','75','76','77', '78','79','80','81','82','83','84','85','86','87',
            '88', '89','90','91','92','93','94','95','96','97','98','99', '100']
          }
        ]
      });
      $("#cgrand").picker({
        title: "请选择",
        cols: [
          {
            textAlign: 'center',
            values: ['', '']
          },
          {
            textAlign: 'center',
            values: ['钻石', '黄金','白银']
          }
        ]
      });
      $("#cstate").picker({
        title: "请选择",
        cols: [
          {
            textAlign: 'center',
            values: ['', '']
          },
          {
            textAlign: 'center',
            values: ['已看中', '已付定金','已签合同']
          }
        ]
      });
      $("#cmakestate").picker({
        title: "请选择",
        cols: [
          {
            textAlign: 'center',
            values: ['', '']
          },
          {
            textAlign: 'center',
            values: ['老客户', '新客户']
          }
        ]
      });
      $("#chousetype").picker({
        title: "请选择",
        cols: [
          {
            textAlign: 'center',
            values: ['', '']
          },
          {
            textAlign: 'center',
            values: ['一室一厅','两室一厅','两室两厅','三室两厅']
          }
        ]
      });
      /* */
      </script>
  	</body>
  </html>
